package actions;

import java.util.*;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.RowSet;

import model.StudentModel;

import org.apache.struts.action.*;

import db.DbException;
import forms.ChairsForm;


public class ChairsStartAction extends Action 
{
	public ActionForward execute(ActionMapping mapping, ActionForm form, 
		    HttpServletRequest request, HttpServletResponse response) {
		
		if (StudentModel.reviewStarted() == true)
			return (mapping.findForward("revstartedsuccess"));
		
		ChairsForm iForm = (ChairsForm) form;
		
		Vector reviewers = StudentModel.getAllReviewers();
		request.getSession().setAttribute("reviewers", reviewers);
		
		int numReviewers = StudentModel.numReviewers();
		iForm.setNumReviewers(numReviewers);
	
		return (mapping.findForward("success"));	
	}

}
